#include <vector>
#include "MotorCycle.h"
#include "FamilyCar.h"
#include "SportsCar.h"
#include "Lorry.h"

int main5_abc( void );
int main5_d( void );


int main( void )
{
	//main5_abc();

	try
	{
		main5_d();
	}
	catch( VehicleException ve )
	{
		ve.Report(cout);
	}
	

	cin.get();
	return 0;
}


void print( Vehicle& vehicle )
{
	vehicle.Print(cout);
}
int main5_abc( void )
{
	cout << "Main5_abc():" << endl;

	vector<Vehicle*> vehicles;
	Vehicle vehicle("Volvo", 2010, 500, 1250);
	Lorry lorry("Scania", 2013, 1500, 3500, 10000);
	Car car("Saab", 2000, 150, 300, 5, 5);
	MotorCycle motorcycle("Kawasaki", 1995, 25, 50, 2);
	SportsCar sportscar("Koeningsegg", 2013, 600, 2500, 2, 2, 425);
	FamilyCar familycar("Volkswagen", 1994, 5, 10, 5, 3);

	vehicles.push_back(&vehicle);
	vehicles.push_back(&lorry);
	vehicles.push_back(&car);
	vehicles.push_back(&motorcycle);
	vehicles.push_back(&sportscar);
	vehicles.push_back(&familycar);

	print(motorcycle);
	print(sportscar);

	for( auto &v : vehicles )
	{
		v->Print( cout );
	}



	return 0;
}

int main5_d( void )
{
	cout << "Main5_d():" << endl << endl;

	Vehicle vehicleCorrect("Volvo", 2005, 75, 110);
	vehicleCorrect.Print(cout);
	Vehicle vehicleWrong("Volvo", 1500, 1000, 5000);
	vehicleWrong.Print(cout);


	return 0 ;
}